package com.xs.ahoi.hcxs.utils;

import android.graphics.Color;
import com.xs.ahoi.hcxs.dao.ConfigDao;
import com.xs.ahoi.hcxs.dao.DBHelper;

/**
 * @author fuhuichao
 * 2017年6月22日16:58:12
 * 常量类
 */
public class Constants {

//    public static Tencent mTencent;
//    public static final String APPID = "1106987207";
//    public static AppUserInfo ahoiUserInfo;

    public static final String SERVER_HOST = "http://nas.fhczz.top:1515";

    // 翻页动画-仿真，覆盖，滑动，无
    public static final int PAGE_STYLE_SIMULATION = 0;
    public static final int PAGE_STYLE_SLIDE = 1;
    public static final int PAGE_STYLE_COVER = 2;
    public static final int PAGE_STYLE_NONE = 3;
    public static final int REQUEST_CODE_ACTIVITY = 1;
    // 书籍目录返回代码
    public static final int RESULT_CODE_CATALOG_OR_SEARCH = 1002;
    public static String DEFAULT_ID = "id";
    public static String PATH = "path";
    public static String POSITION = "position";
    public static String BOOK_ID = "bookId";
    // 小说内容和标题的默认字体大小
    public static float DEFAULT_CONTENT_TEXTSIZE = 56f;
    public static float DEFAULT_TITLE_TEXTSIZE = 38f;
    // 字号变化步长
    public static float TEXT_SIZE_CHANGE_STEP = 8f;
    // 最大字体
    public static float TEXT_SIZE_MAX = 120f;
    // 最小字体
    public static float TEXT_SIZE_MIN = 32f;
    // 默认亮度
    public static int DEFAULT_LIGHT = 125;
    // 是否选中系统亮度
    public static boolean DEFAULT_IS_SYS_LIGHT = true;
    // 是否选中常亮
    public static boolean DEFAULT_IS_ALWAYS_LIGHT = true;
    // 是否选中朗读高亮
    public static boolean DEFAULT_IS_HIGH_LIGHT = true;
    // 默认行距
    public static int DEFAULT_ROW_SPACING = 10;
    public static int DEFAULT_ROW_SPACING_DIFF = 10;
    // 默认边距
    public static float DEFAULT_CONTENT_TOP = 100f;
    public static float DEFAULT_CONTENT_BOTTOM = 100f;
    public static float DEFAULT_CONTENT_LEFT = 50f;
    public static float DEFAULT_CONTENT_RIGHT = 50f;
    public static float DEFAULT_MSG_TOP = 20f;
    public static float DEFAULT_MSG_BOTTOM = 20f;
    // 电池边框长宽
    public static float POWER_BORDER = 2f;
    public static float POWER_WIDTH = 60f;
    public static float POWER_HEIGHT = 30f;
    // 电池电极长宽
    public static float POWER2_WIDTH = 6f;
    public static float POWER2_HEIGHT = POWER_HEIGHT / 3;
    // 电池电量内边距
    public static float POWER_PADDING = 3f;
    // 截屏区域尺寸，间隔
    public static final int SHORT_CUT_WIDTH = 350;
    public static final int SHORT_CUT_HEIGHT = 200;
    public static final int SHORT_CUT_MARGIN = 50;
    // 文字选中滑块
    public static final float SELECT_SLIDER_RADIUS = 30f;
    // 默认编码
    public static String DEFAULT_CHARSET = "UTF-8";
    // 朗读高亮颜色
    public static int CONTENT_HIGHLIGHT_COLOR = Color.parseColor("#22ACEB");
    // 正则表达式智能断章
    public static String REGEX_PATTERN_CATEGORY = "第([\u4e00-\u9fa5]|[0-9]){1,8}(章|节).{0,}(\n|\r\n)";
    // 正则 标点符号
    public static String REGEX_PATTERN_POINT = "\\p{P}|\\p{Z}|\r|\n";
    // 替换后的序号
    public static String REPLACE_INDEX = "{index}";
    // 标题最大文字长度
    public static int CONTENT_TITLE_MAX_SIZE = 35;
    // 正则表达式去除段首空白字符
    public static String REGEX_PATTERN_PARAGRAGH = "^(\t| ){0,}";
    // 正则表达式去除章节目录的回车
    public static String REGEX_PATTERN_SECTITLE = "(\r\n)|\n|\r";
    // 首行缩进字符
    public static String FIRST_LINE_INDENT = "\u3000\u3000";
    // 定时播发停止之后，60秒内可以继续定时
    public static int TIME_OVER_DELAY_MILLISECOND = 60 * 1000;
    // 定时播放重新继续时，继续10分钟
    public static int TIME_OVER_RECONTINUE_SECOND = 10 * 60;

    // 数据库备份文件路径
    public static final String BASE_PATH = "/HC_TingShu/";
    public static final String SD_CARD_PATH = FileUtil.getSdCard() + BASE_PATH;
    public static final String DB_BACKUP_PATH = SD_CARD_PATH + DBHelper.DATABASE_NAME;
    public static final String CONFIG_BACKUP_PATH = SD_CARD_PATH + ConfigDao.CONFIG_NAME + ".xml";
    // 文件下载地址
    public static final String FILE_DOWN_PATH = BASE_PATH + "downloads";
    public static final String FILE_DOWN_PATH_FULL = SD_CARD_PATH + "downloads";
    // 错误日志路径
    public static final String ERROR_LOG_NAME = "error.log";
    public static final String ERROR_LOG_PATH = SD_CARD_PATH + ERROR_LOG_NAME;

    // 百度bat离线资源文件
    public static final String BD_TTS_DIR = FileUtil.getSdCard() + "/baiduTTS";
    public static final String BD_TTS_TEXT_FILENAME = "bd_etts_text.dat";
    public static final String BD_TTS_MODEL_FILENAME = "bd_etts_common_speech_f7_mand_eng_high_am-mix_v3.0.0_20170512.dat";
    public static final String BD_TTS_TEXT_FILENAME_PATH = BD_TTS_DIR + "/" + BD_TTS_TEXT_FILENAME;
    public static final String BD_TTS_MODEL_FILENAME_PATH = BD_TTS_DIR + "/" + BD_TTS_MODEL_FILENAME;

    // 标记是否继续替换
    public static Boolean canReplace = false;

    // 是否继续播放(手动暂停后为false，手动播放后为true，焦点失去导致的暂停不修改此变量)
    public static Boolean continueToPlay = false;

    // 初始化TTS
    public static Boolean initTTS = true;

    // 开关控制是否在初始化后开始播放
    public static boolean startAfterInit = false;

    // 背景资源 0:背景色 1:正文 2:标题和电量时间等信息 3:按钮边框颜色
    public static final String[][] backgroundColors = {
            {"#EDDAAF", "#5E4330", "#878787", "#F5E5C1"},// 肉色
            {"#D6EED4", "#24482E", "#748379", "#E4F7D8"},// 绿色
            {"#EEC5D3", "#7F1835", "#b6929c", "#EDDBE3"},// 粉色
            {"#FAF6ED", "#333333", "#747474", "#FCFAF6"},// 白色
            {"#463933", "#9C7C65", "#a18b7a", "#58473F"},// 褐色
            {"#031F2B", "#415765", "#71838B", "#274855"},// 黑色
    };

    public enum ChangeType {
        add, sub
    }

    public enum ShareType {
        text, file
    }

}
